class Employee :
    def __init__(self,name) -> None:
        self.name = name
    def get_salary(self) :
        pass
class Manager(Employee) :
    def __init__(self, name,salary=15000) -> None:
        super().__init__(name)
        self.salary = salary
    def get_salary(self):
        return self.salary
    def __str__(self) :
        return f"{self.name}的薪资为{self.get_salary()}"
class Programmer(Employee) :
    def __init__(self, name,base_salary=12000,over_time=0) -> None:
        super().__init__(name)
        self.base_salary = base_salary
        self.__over_time = over_time
    def get_salary(self):
        if self.__over_time < 0 :
            raise ValueError("输入工作时长有误")
        elif self.__over_time > 20 :
            self.__over_time = 20 
        return self.base_salary + 100 * self.__over_time
    def __str__(self) -> str:
        return f"{self.name}的薪资为{self.get_salary()}"
class SoftTest(Employee) :
    def __init__(self, name,base_salary=8000,bug_num=0) -> None:
        super().__init__(name)
        self.base_salary = base_salary
        self.bug_num = bug_num
    def get_salary(self):
        return self.base_salary + 5 * self.bug_num
    def __str__(self) -> str:
        return f"{self.name}的薪资为{self.get_salary()}"
def main():
    Employee_list = [
        Manager("Nun1"),Manager("Nun2"),Manager("Nun3",1000),
        Programmer("Mun1"),Programmer("Mun2",1000,10),Programmer("Mun3",1000,20),
        SoftTest("Bun1"),SoftTest("Bun2"),SoftTest("Bun3",9000,100),
    ]
    for emp in Employee_list :
        if isinstance(emp,Programmer) :
            print("程序员",emp)
        elif isinstance(emp,Programmer) :
            print("产品经理",emp)    
        else :
            print("测试工程师",emp)
if __name__ == "__main__" :
    main()